package comman.duke 
{
	import flash.display.DisplayObject;
	/**
	 * ...
	 * @author jerry.d
	 */
	public class ShakeItem 
	{
		public var name:String;
		public var gap:int;
		public var cnt:int;
		public var display:DisplayObject;
		public var type:int;
		public var ox:int;
		public var oy:int;
		public var or:int;
		public var callBack:Function;
		public function ShakeItem() 
		{
			
		}
		
		public function init(name:String, display:DisplayObject, gap:int, cnt:int, type:int, ox:int=0, oy:int=0, callBack:Function=null):void{
			this.name = name;
			this.display = display;
			this.gap = gap;
			this.cnt = cnt;
			this.type = type;
			this.ox = ox;
			this.oy = oy;
			this.or = display.rotation;
		}
		
		public function reset():void{
			if ( display != null ){
				if(type == ShakeMgr.SHAKE_HOR){
					display.x = this.ox;
				}else if(type == ShakeMgr.SHAKE_VER){
					display.y = this.oy;
				}else if(type == ShakeMgr.SHAKE_TWIST){
					display.rotation = this.or;
				}
			}
			if ( callBack != null ){
				callBack();
			}
		}
	}

}